package com.liwy3.lark.msgbot;

import com.liwy3.YQMap;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.ArrayList;
import java.util.List;

/**
 * https://open.feishu.cn/document/ukTMukTMukTM/uEjNwUjLxYDM14SM2ATN
 */
@Accessors(chain = true)
@Data
public class LarkBotMsgCard {

    /**
     * https://open.feishu.cn/document/ukTMukTMukTM/uAjNwUjLwYDM14CM2ATN
     */
//    private YQMap config = new YQMap().append("wide_screen_mode", true).append("enable_forward", true);
    private YQMap header;
    private List<Object> elements = new ArrayList<>();

    public void setHeader(String title, String template) {
        header = new YQMap().append("template", template)
                .append("title", new LarkBotMsgText().setContent(title).setTag(LarkBotMsgText.TagPlanText));
    }

}
